package com.wendy.read.member.validation;


import com.wendy.read.member.annotation.ArticleState;
//import jakarta.validation.ConstraintValidator;
//import jakarta.validation.ConstraintValidatorContext;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class ArticleStateValidation implements ConstraintValidator<ArticleState, String> {

    @Override
    public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
        if (value == null){
            return false;
        }

        return value.equals("草稿") || value.equals("已发布");
    }
}
